{
  "properties" : { },
  "id" : "9f66afefc24641c69022808d18f4c9d6",
  "script" : null,
  "groupId" : "74af8e1135d2474eb9b6b4081e6d5967",
  "name" : "批量绑定设备",
  "createTime" : 1727071031949,
  "updateTime" : 1726653340469,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "bindDevice",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "{\r\n    \"deviceIds\": [\r\n        \"D2173343257502001764\",\r\n        \"D1814237884760947677\"\r\n    ],\r\n    \"groupId\": \"4c3aa507-0b3a-477b-9af5-b1508074f684\"\r\n}",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"status\": 200,\n    \"message\": \"success\",\n    \"data\": {}\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
 import com.kd.ndmp.util.IdUtil




 List ids = body.deviceIds;
 String groupId = body.groupId;
 List groupDeviceList = new ArrayList();
 ids.forEach(v -> {
     var id = IdUtil.getSnowflakeNextId()
     var ob = {
         "id": id,
         "groupId": groupId,
         "deviceId": v
     }
     groupDeviceList.add(ob);
 });

 db.table("ndmp_group_device_relation").batchInsert(groupDeviceList)

 return true;